/*
 * @Author: byron
 * @Date: 2021-11-17 22:15:50
 * @LastEditTime: 2022-05-09 11:56:49
 */
export function createDynamic(dynamic) {
    const { created_by, desc, title } = dynamic
    return {
        title: created_by,
        avatar: 'https://portrait.gitee.com/uploads/avatars/user/2583/7749008_echoc_1627731681.png!avatar60',
        info: `${title} ${desc}`,
    }
}
export function createArticle(article) {
    const { id, desc, title, weight, status, summary } = article
    return {
        id,
        status: status ? true : false,
        weight: weight ? true : false,
        title: title,
        description: desc,
        summary,
        avatar: 'http://image.huos77.cn/img/avatar.svg',
        href: 'https://huos77.cn',
        action: {
            StarOutlined: 111,
            LikeOutlined: 222,
            MessageOutlined: 333,
        },
    }
}

/**
 * 截取文章内容函数
 * @param {*} string
 * @param {*} start
 * @param {*} end
 * @returns
 */
export function subString(string, start, end) {
    return string.replace(/[\s* |#*|`+|>+]/g, '').substring(start, end)
}
